<template>
    <h3>For list Demo</h3>
    <div v-for="(name, index) in names">{{index}} - {{name}}</div>
    <div v-for="(_id, _class, index) in attrs" :id="attr.id" :class="attr.class" :key="_id">
        {{index}} - {{_id}} - {{_class}} <!-- 不推荐使用index作为:key -->
    </div>
</template>

<script>
  export default {
    data() {
      return {
        names: ['John', 'Mary', 'Bob'],
        attrs: [
            {id: 'id1', class: 'class1'},
            {id: 'id2', class: 'class2'},
        ],
      }
    }
  }
</script>
